/**
 * @author  Thomas Lehmann
 * @file    Stylesheets.js
 *
 * Copyright (c) 2013 Thomas Lehmann
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
 * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
 * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all copies
 * or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
 * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
 * DAMAGES OR OTHER LIABILITY,
 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */
var log;
var Class;
var Factory;

// this is used when developing this tool with node
if (typeof require == 'function') {
    var ClassTools = require("./ClassTools.js");
    log      = ClassTools.log;
    Class    = ClassTools.Class;
    Factory  = ClassTools.Factory;
}

var DefaultStyleSheets = Class({
    /**
        Registering styles for individual tokens
     */
    initialize: function() {
        this.data = new Array();
        this.data["pre"]                  = "background: white; margin: 0;";
        this.data["line-number"]          = "color: black; background: #f0f0f0; font-weight:bold;";
        this.data["bracket"]              = "color: red";
        this.data["operator"]             = "color: blue";
        this.data["line-comment"]         = "color: #458B00; font-weight:bold";
        this.data["block-comment"]        = "color: #458B00";
        this.data["double-quoted-string"] = "color: magenta";
        this.data["single-quoted-string"] = "color: magenta";
        this.data["identifier"]           = "color: #606060";
        this.data["keyword"]              = "color: #580000; font-weight:bold";
        this.data["special-character"]    = "color: orange";
        this.data["scope"]                = "color: #606060";
        this.data["number"]               = "color: #000080; font-weight:bold";
    },

    /**
        @param  name is the name of the style which is the same as
                used by registering scanned tokens.
        @return undefined if not found otherwise the style string which
                is used for a style attribute of a HTML tag.
     */
    getStyle: function(name) {
        return this.data[name];
    }
});

var DarkStyleSheets = Class({
    /**
        Registering styles for individual tokens
     */
    initialize: function() {
        this.data = new Array();
        this.data["pre"]                  = "margin: 0; background: black";
        this.data["line-number"]          = "color: black; background: white; font-weight:bold;";
        this.data["bracket"]              = "color: yellow";
        this.data["operator"]             = "color: #ffffff;";
        this.data["line-comment"]         = "color: gray; font-weight:bold";
        this.data["block-comment"]        = "color: gray";
        this.data["double-quoted-string"] = "color: red";
        this.data["single-quoted-string"] = "color: red";
        this.data["identifier"]           = "color: #00ff00";
        this.data["keyword"]              = "color: #0000ff; font-weight:bold";
        this.data["special-character"]    = "color: cyan";
        this.data["scope"]                = "color: #606060";
        this.data["number"]               = "color: cyan; font-weight:bold";
    },

    /**
        @param  name is the name of the style which is the same as
                used by registering scanned tokens.
        @return undefined if not found otherwise the style string which
                is used for a style attribute of a HTML tag.
     */
    getStyle: function(name) {
        return this.data[name];
    }
});

var StylesheetsFactory = new Factory();
StylesheetsFactory.register("default", DefaultStyleSheets);
StylesheetsFactory.register("dark"   , DarkStyleSheets);

if (typeof(exports) != 'undefined') {
    exports.StylesheetsFactory = StylesheetsFactory;
}
